Skip to main content

Class Const<TValue, TValueType>

Base class for constant instructions.

Assembly: WaaS.Core.dll
Declaration
public abstract class Const<TValue, TValueType> : Instruction where TValue : unmanaged where TValueType : struct, IValueType<TValue>

Inheritance: System.Object -> WaaS.Models.Instruction

Derived:
WaaS.Models.ConstF32, WaaS.Models.ConstF64, WaaS.Models.ConstI32, WaaS.Models.ConstI64

Properties

Value

View Source
Declaration
public TValue Value { get; }

Methods

Execute(WasmStackFrame)

Executes the instruction.

View Source
Declaration
public override void Execute(WasmStackFrame current)
Parameters
TypeName
WaaS.Runtime.WasmStackFramecurrent

PreValidateStackState(in ValidationContext)

Get the number of values to pop and push from the stack to validate stack depth.

View Source
Declaration
public override (uint popCount, uint pushCount) PreValidateStackState(in ValidationContext context)
Returns

System.ValueTuple<System.UInt32,System.UInt32>

Parameters
TypeName
WaaS.Models.ValidationContextcontext

ValidateStackState(in ValidationContext, ref ValidationBlockStackState)

Simulates stack operations to validate the stack state.

View Source
Declaration
public override void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
TypeName
WaaS.Models.ValidationContextcontext
WaaS.Models.ValidationBlockStackStatestackState